package com.hejun.myjedis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(JedisProperties.class)
public class MyJedisAutoConfigure {
    @Autowired
    JedisProperties jedisProperties;
    @Bean
    JedisServer jedisServer(){
        JedisServer jedisServer = new JedisServer(jedisProperties.getUserName(), jedisProperties.getPwd());
        return jedisServer;

    }
}
